﻿package org.openChart.display 
{
	import flash.filters.GradientGlowFilter;
	import flash.geom.Point;
	import flash.system.IMEConversionMode;
	import org.openChart.meta.data.DataElement;
	
	/**
	 * The base class of display elements.
	 * 
	 * @author Chongyuan
	 */
	public class DisplayElement extends DisplayBaseObject
	{
		private var value_:Number = 0;
		private var showValue_:String;
		private var parent_:DisplayGroup;
		
		public static const SHOW_VALUE_ALWAYS:String = "always";
		public static const SHOW_VALUE_SELETED:String = "selected";
		public static const SHOW_VALUE_NEVER :String = "never";
		
		public function DisplayElement( element:DataElement, displayGroup:DisplayGroup ) 
		{
			this.parent_ = displayGroup;
			this.value_ = element.getValue();
			
			super(element);
		}
		
		public function set value( value_:Number):void
		{
			this.value_ = value_;
		}
		
		public function get value():Number
		{
			return this.value_;
		}
		
		public function set showValue( showValue_:String):void
		{
			this.showValue_ = showValue_;
		}
		
		public function get showValue():String
		{
			return this.showValue_;
		}
		
		public function get element():DataElement
		{
			return dataModel as DataElement;
		}
		
		public function get parent():DisplayGroup
		{
			return parent_;
		}
		
		public function toString():String
		{
			var str:String = "Object:DisplayElement ";
			str += "[value = " + value + "]";
			str += "[showValue = " + showValue + "]";
			str += "[position = " + position + "]";
			return str;
		}
	}
	
}